
from django.shortcuts import render
from rest_framework.filters import OrderingFilter
from rest_framework.generics import ListAPIView, GenericAPIView,RetrieveAPIView, CreateAPIView

from index.serializer import NewsSerializer, CoAPIView
from .models import IndexPage, IndexComment, IndexDetails


class NewsViws(ListAPIView):
    """新闻分类"""
    serializer_class = NewsSerializer

    queryset = IndexPage.objects.all()

class DetailsViws(ListAPIView):

    """新闻详情"""
    serializer_class = CoAPIView

    queryset = IndexDetails.objects.all()

# class CommentViws(CreateAPIView):
#
#     serializer_class = Commentserializer
#
#     queryset = IndexComment.objects.all()








